home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
jaz_clib.arc
/
JZGETDIR.C
< prev
next >
Wrap
Text File
|
1989-04-09
|
1KB
|
37 lines
/*
┌────────────────────────────────────────────────────────────────────────────┐
│jzgetdir.c │
│Return a pointer to a buffer which contains the low level directory info. │
│Including information about deletes, etc. │
│ │
│ (C) JazSoft Software by Jack A. Zucker (301) 794-5950 │
└────────────────────────────────────────────────────────────────────────────┘
*/
jzgetdir( fdir , fdrive , fentries)
TDIR **fdir;
int fdrive;
int *fentries;
{
TDISKBLK wdisk;
int wstart; /* start of directory sectors */
TDIR *malloc();
diskinfo(fdrive,&wdisk); /* get disk information */
*fentries = wdisk.numdir; /* number of dir entries */
/* directory starts immediately after the two copies of the FAT */
/* which are immediately after the boot sector */
wstart = (wdisk.sectfat << 1) + 1;
if ( ! (*fdir = malloc(wdisk.numdir * 32))) {
printf("Insufficient Memory for directory. Aborting...");
exit(0);
}
dosreads(fdrive,wstart,wdisk.numdir * 32 / wdisk.bytes,*fdir);
}